package alg20250207;

public class Text2 {
    public int maxArea(int[] height) {
        int maxV = 0, n = height.length;
        for (int left = 0, right = n - 1; left < right;) {
            int h = Math.min(height[left], height[right]);
            int v = (right - left) * h;
            maxV = Math.max(v, maxV);
            if(height[left] < height[right]) left++;
            else right--;
        }
        return maxV;
    }
}
